export default {
    namespaced: true,
    state: {
        isShowToastModal: false,
        // 提示内容
        toastMsg: '',
        toastType: ''
    },
    mutations: {
        changeIsShowToastModal(state, payload) {
            state.isShowToastModal = payload.flag;
            if (payload.flag) {
                state.toastMsg = payload.toastMsg;
                state.toastType = payload.toastType;
            }

        }
    },
    actions: {
        asyncChangeIsShowToastModal(context, payload) {
            context.commit("changeIsShowToastModal", payload);

            setTimeout(() => {
                context.commit('changeIsShowToastModal', {
                    isShowToastModal: false
                })
            }, 2000)

        }
    }
}